#!/usr/bin/env sh

# 确保脚本抛出遇到的错误
set -e

now_branch_name=`git symbolic-ref --short -q HEAD`

if [ $now_branch_name == "develop" ]
then
    yarn build

    cd dist

    git init -b master
    git add -A
    git commit -m 'deploy'

    git push -f git@10.1.10.229:/www/wwwroot/test.robot.com/test.git master

    cd ..
    rm -rf dist 
fi

cd -